package com.ruoyi.project.module.whd.review;

import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.project.domain.YhAssist;
import com.ruoyi.project.service.IYhAssistService;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Objects;

import static com.ruoyi.common.security.utils.SecurityUtils.getLoginUser;
import static com.ruoyi.common.security.utils.SecurityUtils.getUsername;

/**
 * 领用-协助信息Controller
 * 
 * @author ruoyi
 * @date 2023-04-10
 */
@RestController
@RequestMapping("/whd/assist")
public class WhdAssistController extends BaseController
{
    @Autowired
    private IYhAssistService yhAssistService;

    /**
     * 查询领用-协助信息列表
     */
//    @RequiresPermissions("project:assist:list")
    @GetMapping("/role")
    public int assistRole(YhAssist yhAssist)
    {
//        startPage();
        LoginUser loginUser = getLoginUser();
//        SysUser sysUser = loginUser.getSysUser();
        String userID= getUsername();
        yhAssist.setAssistId(userID);
        List<YhAssist> list = yhAssistService.selectYhAssistList(yhAssist);
        if(list.size()==0){
            return 0;
        }else {
            return 1;
        }

    }
}
